<!--会员卡页面-->
<template>
  <div class="card">
    <div class="card_top">
      <span>会员卡</span>
      <img src="../../../static/image/currentduan.png" alt />
    </div>
    <ul>
      <li
        v-for="(item, index) in list"
        :key="index"
        :style="{ background: 'url(' + item.cover + ')  no-repeat' }"
      >
        <div class="li_top">
          <span v-if="item.isBuy == 1">已拥有</span>
        </div>
        <div class="li_bottom" @click="Detail(item.id)">
          <img src="../../../static/image/lrone.png" alt />
          <div class="li_text">
            <p class="li_title">{{ item.name }}</p>
            <p class="introduce">{{ item.info }}</p>
          </div>
        </div>
      </li>
    </ul>
    <footer>
      <Footers></Footers>
    </footer>
  </div>
</template>
<script>
import axios from "axios";
import { cardList } from "../../api/api";
import querystring from "query-string";
import { Toast, Indicator } from "mint-ui";
import Footers from "./footer";

export default {
  name: "Clubcard",
  components: {
    Footers,
  },
  data() {
    return {
      list: [],
    };
  },
  created() {},
  methods: {
    cardList() {
      Indicator.open("加载中...");
      var params = {};
      var params = querystring.stringify(params);
      var a = localStorage.getItem("token");
      a = JSON.parse(a);
      cardList(params, a).then((res) => {
        if (res.data.code == 1) {
          this.list = res.data.data;
          Indicator.close();
        } else {
          Indicator.close();
          Toast(res.data.message);
        }
      });
    },
    //跳转详情
    Detail(id) {
      this.$router.push({
        path: "/Branch/member",
        query: { memberId: id },
      });
    },
  },
  mounted() {
    this.cardList();
  },
};
</script>
<style lang="scss" scoped>
.card {
  width: 100%;
  height: auto;
  padding-bottom: 1.5rem;
  .card_top {
    width: 100%;
    height: 1.7rem;
    position: relative;
    img {
      width: 100%;
      height: 100%;
      position: absolute;
      top: 0;
      left: 0;
      z-index: -1;
    }
  }
  .card_top span {
    display: inline-block;
    font-size: 0.36rem;
    color: #ffffff;
    margin-left: 0.68rem;
    margin-top: 0.8rem;
  }
}
ul {
  width: 100%;
  height: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  li {
    width: 6.94rem;
    height: 3.6rem;
    margin-top: 0.3rem;
    border-radius: 0.16rem;
    background-size: 100% 100% !important;
    .li_top {
      width: 100%;
      height: 0.76rem;
      span {
        width: 1.16rem;
        height: 0.4rem;
        display: inline-block;
        background: #fff1b8;
        border-radius: 0.18rem;
        font-size: 0.24rem;
        color: #ac8a05;
        float: right;
        text-align: center;
        line-height: 0.4rem;
        margin-right: 0.38rem;
        margin-top: 0.3rem;
      }
    }
    .li_bottom {
      width: 100%;
      height: auto;
      display: flex;
      img {
        width: 0.86rem;
        height: 0.86rem;
        margin-left: 0.45rem;
      }
      .li_text .li_title {
        color: #333333;
        font-size: 0.4rem;
        font-weight: bold;
        margin-left: 0.16rem;
        margin-top: 0.15rem;
      }
      .li_text .introduce {
        width: 4.37rem;
        height: 1.1rem;
        font-size: 0.26rem;
        color: #555555;
        margin-top: 0.15rem;
        margin-left: 0.16rem;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 3;
      }
    }
  }
  li:nth-child(1) {
    // background: url("../../../static/image/lrenter.png") no-repeat;
    background-size: 100% 100%;
  }
  li:nth-child(2) {
    // background: url("../../../static/image/lrnine.png") no-repeat;
    background-size: 100% 100%;
    .li_top {
      width: 100%;
      height: 0.76rem;
      span {
        width: 1.16rem;
        height: 0.4rem;
        display: inline-block;
        background: #f4e4c5;
        border-radius: 0.18rem;
        font-size: 0.24rem;
        color: #a36d18;
        float: right;
        text-align: center;
        line-height: 0.4rem;
        margin-right: 0.38rem;
        margin-top: 0.3rem;
      }
    }
  }
  li:nth-child(3) {
    // background: url("../../../static/image/lrten.png") no-repeat;
    background-size: 100% 100%;
    .li_top {
      width: 100%;
      height: 0.76rem;
      span {
        width: 1.16rem;
        height: 0.4rem;
        display: inline-block;
        background: #cad0d4;
        border-radius: 0.18rem;
        font-size: 0.24rem;
        color: #575e64;
        float: right;
        text-align: center;
        line-height: 0.4rem;
        margin-right: 0.38rem;
        margin-top: 0.3rem;
      }
    }
  }
}
</style>